package com.knowledge.graph.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.knowledge.graph.model.entity.GradeAndUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface GradeAndUserMapper extends BaseMapper<GradeAndUser> {
    @Select("select grade_id from grade_and_user where user_id = #{id}")
    Long selectByUserId(Long id);

    @Select("select count(*) from grade_and_user where grade_id = #{gradeId} and user_id = #{userId}")
    int selectByGU(GradeAndUser gradeAndUser);
}
